package com.general.framework.core.enums;

import com.general.framework.core.lang.Strings;

import java.util.Objects;

/**
 * 平台类型定义
 */
public enum PlatformEnum implements IEnum<String> {

//    alipay_lite("alipay-lite","支付宝小程序"),
    wx_lite("weapp-lite","微信小程序"),
    alipay("alipay","支付宝");

    PlatformEnum(String type, String name) {
        this.value = type;
        this.name = name;
    }

    private String value;

    private String name;

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getDesc(Integer value) {
        for (PlatformEnum thisEnum : PlatformEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.name;
            }
        }
        return Strings.EMPTY;
    }

    @Override
    public String value() {
        return value;
    }

    @Override
    public String named() {
        return name;
    }
}
